home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
cpcug.zip
/
DISK.DOC
< prev
next >
Wrap
Text File
|
1987-04-20
|
10KB
|
223 lines
DISK MJH Consulting
Command
Copyright (c) 1985, MJH Consulting
_______________________________________________________________
Purpose: List information on all specified files regardless of
where they reside on the disk.
The display line for each file indicates the complete
complete path specification of all files located.
Based on command parameters, the information may
optionally include the file size in decimal bytes, the
disk space allocated to the file, its percent slack
space, the date and time the file was last written to,
and the file attributes. The information may include
subtotals by directory and a grand total concerning the
files located, and the total amount of free space left
on the disk. A command parameter is available to list
the total allocated space required by the requested
files if they were to be copied to a target disk.
The output information may be formatted and redirected
to a file usable as a batch command file. Although not
normally listed, files with the hidden or system
attribute may be included in the list. Normally only
data file information is listed. A command parameter
is available to list directory file linformation
instead.
Note: This command requires DOS 2 or later and will produce an
error if used with DOS 1.
Format: DISK[/P][/H][/D][/W][/B][/C][/F][/T][/Rd] [d:][filename[.ext]]
Note: The optional filename may not include a path
specification since the entire disk is searched by this command.
Type: Internal External
***
Remarks: The /P parameter causes the display to Pause when the screen is
full. When you are ready to continue listing the information, press
any key. The Ctrl-Break key pair is active at this time and can
abort the command without further output. This parameter may be
used with any other parameter.
The /H parameter permits files with the Hidden and system attributes
to also be selected by the command. This parameter may be used with
any other parameter.
The /D parameter causes Directory files to be selected INSTEAD of
data files. This parameter may not be used with either the /F or
the /R parameters since file size is not computed for the directory
files themselves.
The /W parameter produces a Wide display of the data. The directory
path is specified on a line by itself followed by lines of the
filenames located in that directory. Each line displayed contains
five names. (This parameter is only recommended for 80-column
displays.) This parameter may not be used with the /B or /C
parameters.
Both the /B and /C parameters produce a list, one file per line,
with the path name Concatenated to the front of each filename
located. If redirection of output is done to a disk file, this list
is suitable for editing. With the /B parameter, each complete name
is preceded by the characters "%1 " and followed by the characters
" %2". If redirection of output is done to a disk file, this list
is suitable for subsequent use as a Batch command file. These two
parameters are mutually exclusive. They may not be used with the /W
or /F parameters.
The /F parameter gives Full information for each file. It will list
the file size and allocated space in decimal bytes, the percent
slack space, the date and time, and the file attributes for each
file listed. (This parameter is only recommended for 80-column
displays.) If used with the /W parameter, full information is only
included on whatever total lines are displayed. This parameter may
be used with the /B and /C parameters only if also used with the /T
parameter. This parameter may not be used with the /D parameter.
The /T parameter will cause Totals to be calculated for each
directory in which a file is located. If used with the /B or /C
parameters, this parameter will output only a grand total on the
standard error device.
The /Rd parameter indicates the Results of copying the selected
files to another disk. The proposed target disk drive letter is
entered immediately following the R. A total line indicates the
allocated space required by the files on that disk, and the current
space available on that disk. Less space than indicated may
actually be needed if some of these files would replace existing
ones on that disk. This parameter may not be used with the /D
parameter.
The /W, /F, /B, and /C parameters all define what information will
be listed concerning the located file. If none are specified, the
command lists the standard file information. The directory path is
specified on a line by itself followed by lines of the filenames
located in that directory. The display line for each file indicates
the filename located, its size in decimal bytes and the date and
time the file was last written to. If the /D parameter was
specified, the filenames are directory files and no filesize is
listed.
The command writes all information to the standard output device
which may be redirected or piped. Using either the /B or /C
parameters causes the heading and total lines to list on the
standard error device. The command sets the ERRORLEVEL exit code
upon completion:
0 = normal exit
1 = invalid input parameters
2 = no files located
The DISK command has two format options (any of the parameters may
be used with either option):
Option 1 - List All Files
Use this option to list all the files on a disk. If the /D
parameter is specified, this option will list the directory tree
structure of the disk. For example:
DISK
or
DISK d:
Option 2 - Locate Selected Files
Use this option to locate selected files on a disk. If the /D
parameter is specified, this option will locate selected directory
files on a disk. You can use the global characters ? and * in the
filename and extension parameters. For example:
DISK filename.ext
or
DISK d:filename.ext
Problem: I just want a list of all my disk files.
Example: To list on the printer the names of all the files on the entire disk
enter:
DISK/W >LPT1:
To include in the list the hidden files:
DISK/W/H >LPT1:
Problem: I can't remember what subdirectory I put the file in, or which ones
BACKUP archived.
Example: To locate all files with a file extension of BAT, listing full file
information with attributes, subtotals and totals, as well as
automatic pause at a full screen, enter:
DISK/F/T/P *.BAT
Problem: I have organized my disk into many subdirectories and can't remember
the structure or how much each contains.
Example: To list the names of all directories, enter:
DISK/D/W
To see the actual structure, sort the complete directory names with
the command:
DISK/D/C | SORT
To list the space used by each directory:
DISK/F/T/W | FIND "---"
Problem: Will this gr